๋ฌธ์ ์ํฉ
์๋ฌ๋ฌธ
ClientFetchError: JSON.parse: unexpected character at line 1 column 1 of the JSON data. Read more at [https://errors.authjs.dev#autherror](https://errors.authjs.dev/#autherror)
์๋ฒ ์ปดํฌ๋ํธ์ธ Page
๋ค์์ ๊ฐ๊ฐ const session = await auth()
๋ฅผ ํตํด ์ธ์
์ ๊ฐ์ ธ์ค๋๊ฒ ๊ฐ๋ฅํ๋ค. (์ด auth()
๋ auth.ts
์ ์๋๊ฒ)
๊ทผ๋ฐ ๊ฐ ํ์ด์ง๋ค ์์ ์๋ ํด๋ผ์ด์ธํธ ์ปดํฌ๋ํธ๋ค ์์์ useSession()
์ ์ฌ์ฉํด์ ์ธ์
๋ฐ์ดํฐ๋ฅผ ๊ฐ์ ธ์ค๋ ค๋๊น ๊ณ์ ์๋ฌ๊ฐ ๋ฐ์.
์์ธ
ํด๊ฒฐ
import { handlers } from "@/auth";
export const { GET, POST } = handlers;
์ด๊ฒ ์์ด์ useSession()
์ด ๊ณ์ "GET /api/auth/session 404 in 146ms" 404 ์๋ฌ๊ฐ ๋ฌ๊ฒ.